/**
 * 
 */
package com.zxc.aviator;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import com.googlecode.aviator.AviatorEvaluator;

/**
 * @author Administrator
 *
 */
public class AviatorDemo {

	public static void main(String[] args) {
        Map<String, Object> params = new HashMap<>();
        params.put("score", 85);
        //表达式
        String expression = "score > 90 ? \"优\" : score > 80 ? \"良\" : score > 60 ? \"及格\" : \"不及格\"";
        String result = (String) AviatorEvaluator.compile(expression, true).execute(params);
        System.out.println(result);
        
        result = Objects.toString(AviatorEvaluator.compile("(14*24)", true).execute());
        System.out.println(result);
	}
}
